package com.example.factory.core.repository;

import com.example.factory.core.domain.Level2Dimension;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author Lei Tao
 */
@Repository
public interface Level2DimensionRepository extends CrudRepository<Level2Dimension, Long> {
    @Query("select l from Level2Dimension l where l.archived=false and l.level1Dimension.guid=:level1Guid")
    List<Level2Dimension> selectAll(@Param("level1Guid") String level1Guid);

    Level2Dimension findByGuidAndArchivedFalse(String level2Guid);
}
